(ns pe.p25
  (:use pe.digits))

(defn fib-step [ab]
  (let [n (first ab) a (first (next ab)) b (last ab)]
    [(inc n) b (+ a b)]))

(defn -map [ab]
  [(first ab) (first (next ab))])

(defn fib-seq []
  (map -map (iterate fib-step [1 1 1])))

(println (take 5 (fib-seq)))
(println (first (drop-while #(< (count (digits (last %))) 1000) (fib-seq))))